home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / pmp203.arj / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1993-12-21  |  3KB  |  107 lines

  1. /*********************************************************************
  2. PM Patrol installation
  3. *********************************************************************/
  4. trace 'O'
  5. address CMD
  6.  
  7. '@ECHO OFF'
  8. 'cls'
  9. say "PM Patrol Installation"
  10. say "----------------------"
  11.  
  12. /*********************************************************************
  13. Initialization
  14. *********************************************************************/
  15. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  16. call sysloadfuncs
  17.  
  18. instdrive = ''
  19. instpath = ''
  20. bootdrive = Substr(Translate(Value('PATH',,'OS2ENVIRONMENT')),Pos('\OS2\SYSTEM',Translate(Value('PATH',,'OS2ENVIRONMENT')))-2,2)
  21.  
  22. /*********************************************************************
  23. Get the installation drive and path
  24. *********************************************************************/
  25. say ""
  26. say "Please enter the drive to install upon: (ie. C:)"
  27. parse Upper Pull instdrive
  28. if instdrive == '' then do
  29.   instdrive=bootdrive
  30. end
  31. if right(instdrive, 1)<>':' then do
  32.   instdrive=instdrive||':'
  33. end 
  34.  
  35.  
  36. say ""
  37. say "PM Patrol creates a subdirectory called PMP for it's files."
  38. say "Please enter the directory where PMP should be placed: (blank for root)"
  39. parse Upper Pull intpath
  40. if intpath <> '' then do
  41.   if left(intpath, 1) <> '\' then do
  42.     intpath='\'||intpath
  43.   end
  44. end
  45. intpath=instdrive||intpath
  46. instpath=intpath||"\PMP"
  47.  
  48. say "PM Patrol will be installed in: " instpath
  49. say "Is this correct? (Y/N)"
  50. parse Upper Pull response
  51. if response <> 'Y' then do
  52.   say "PM Patrol installation aborted.  Nothing installed."
  53.   exit 1
  54. end
  55.  
  56. 'md ' intpath  ' 1>nul 2>nul'
  57. 'md ' instpath ' 1>nul 2>nul'
  58. say "Installing PM Patrol files..."
  59. 'copy * ' instpath ' 1>nul'
  60. if rc <> 0 then do
  61.   say "Problem copying files to " instpath
  62.   exit 1
  63. end
  64.  
  65. /*********************************************************************
  66. Define and Create the Folder
  67. *********************************************************************/
  68. say "Creating WorkPlace objects..."
  69.  
  70. foldobj='<PMPatrol>'
  71. foldtitle='PM Patrol'
  72. foldicon='pmpfoldr.ico'
  73.  
  74. call SysCreateObject 'WPFolder', foldtitle,'<WP_DESKTOP>','OBJECTID='||foldobj||';ICONFILE='||instpath||'\'||foldicon||';','R'
  75.  
  76. /*********************************************************************
  77. Create Reference Program ICONs in the Folder
  78. *********************************************************************/
  79. progobj='PMP_Info'
  80. progname='view.exe'
  81. progtitle='Information'
  82. progpath=bootdrive||'\os2'
  83. progtype='PM'
  84. progparm='pmpatrol.inf'
  85. call CreateProgram
  86.  
  87. progobj='PMP_Patrol'
  88. progname='pmpatrol.exe'
  89. progtitle='PM Patrol'
  90. progpath=instpath
  91. progtype='PM'
  92. progparm=''
  93. call CreateProgram
  94.  
  95. /*********************************************************************
  96. let em know everything worked
  97. *********************************************************************/
  98. say "PM Patrol sucessfully installed."
  99. exit 0
  100.  
  101. /*********************************************************************
  102. create a program object in a folder
  103. *********************************************************************/
  104. CreateProgram:
  105.   call SysCreateObject 'WPProgram',progtitle,foldobj,'OBJECTID='||progobj||';EXENAME='||progpath||'\'||progname||';PROGTYPE='||progtype||';PARAMETERS='||progparm||';STARTUPDIR='||instpath||';','R'
  106.   return
  107.